package cn.wolfcode.service;

import cn.wolfcode.domain.Employee;
import cn.wolfcode.qo.EmployeeQueryObject;
import com.github.pagehelper.PageInfo;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

public interface IEmployeeService {
    //增删改查
    void save(Employee employee, Long[] ids);
    void update(Employee employee,Long[] ids);
    void delete(Long id);
    Employee get(Long id);
    List<Employee> listAll();

    /**
     * 获取查询结果
     * @param qo
     * @return
     */
    PageInfo<Employee> query(EmployeeQueryObject qo);

    /**
     * 登录查询
     * @param username
     * @param password
     * @return
     */
    Employee login(String username, String password);

    /**
     * 更新密码
     * @param employee
     * @param oldPassword
     * @param newPassword
     */
    void updatePwd(Employee employee, String oldPassword, String newPassword);

    /**
     * 重置密码
     * @param employee
     * @param newPassword
     */
    void resetPwd(Employee employee, String newPassword);

    /**
     * 批量删除
     * @param ids
     */
    void deleteBatch(Long[] ids);

    /**
     * 根据名称查询
     * @param name
     * @return
     */
    Employee selectByName(String name);

    /**
     * 导出
     * @return
     */
    Workbook exportXls();

    /**
     * 导入
     * @param file
     * @throws IOException
     */
    void importXls(MultipartFile file) throws IOException;

    /**
     * 根据角色编码来查询员工
     * @param sns
     * @return
     */
    List<Employee> selectByRoleSn(String... sns);

}
